package com.yujn.task;

import cn.hutool.core.date.DateUtil;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class PrintTask {
    @Scheduled(fixedDelay = 2000)
    public void print(){
        System.out.println(DateUtil.now() + " 定时任务执行了");
    }
}
